package cn.kshost.zqyg.manager.controller;

import cn.kshost.zqyg.manager.service.ProductUnitService;
import cn.kshost.zqyg.model.entity.base.ProductUnit;
import cn.kshost.zqyg.model.vo.common.Result;
import cn.kshost.zqyg.model.vo.common.ResultCodeEnum;
import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/product/productUnit")
@Tag( name = "商品单位")
public class ProductUnitController {

    @Autowired
    private ProductUnitService productUnitService;

    @Operation( summary = "查询所有商品单位")
    @GetMapping("findAll")
    public Result findAll(){

       List<ProductUnit> productUnitList =  productUnitService.findAll();
       return  Result.build(productUnitList, ResultCodeEnum.SUCCESS);



    }
}
